#ifndef ASSERTS_H_JM_20130112
#define ASSERTS_H_JM_20130112

#include <iostream>
#include <cassert>

#include "UnitTester.h"

#define JM_EXPECT_EXCEPTION_EX(fun, expectedException,  getModel, file, line) {\
	jmlib::UnitTester::getInstance()->incrementPerformedTestCount();\
	try {\
		fun;\
		jmlib::UnitTester::getInstance()->testFail("Expected exception "#expectedException, getModel, file, line);\
	}\
	catch (expectedException) { }\
}

#define  JM_EXPECT_EXCEPTION(fun, expectedException) JM_EXPECT_EXCEPTION_EX(fun, expectedException, __FUNCTION__, __FILE__, __LINE__)


#define JM_EXPECT_VALUE_EX(realValue, expectedValue, getModel, file, line) {\
	jmlib::UnitTester::getInstance()->incrementPerformedTestCount();\
	if ((realValue) != (expectedValue)) {\
		jmlib::UnitTester::getInstance()->testFail(\
			"Expected value ", getModel, file, line);\
	}\
}

#define JM_EXPECT_VALUE(realValue, expectedValue) JM_EXPECT_VALUE_EX(realValue, expectedValue, __FUNCTION__, __FILE__, __LINE__)

//#define JM_EXPECT_VALUES_EX(realValues, expectedValues, elementCount, test, file, line) {\
//	jmlib::UnitTester::getInstance()->incrementPerformedTestCount();\
//	for (size_t i = 0; i < elementCount; ++i) {\
//		if (realValues[i] != expectedValues[i]) {\
//			jmlib::UnitTester::getInstance()->testFail(\
//				"Expected value " + , test, file, line);\			
//			break;\
//		}\
//	}\
//}
//
//#define JM_EXPECT_VALUES(realValues, expectedValues, elementCount) JM_EXPECT_VALUES_EX(realValues, expectedValues, elementCount, test, file, line)

#endif
